$(function () {
    //-------------------------------登录操作---------------------------------
    // let form = layui.form
    $('.layui-form').on('submit', function (e) {
        e.preventDefault()
        let fd = $(this).serialize()
        console.log(fd);
        $.ajax({
            type: 'post',
            url: 'api/login',
            data: fd,
            success: function (res) {
                // console.log(res);
                if (res.status !== 0) {
                    layer.msg(res.message)
                } else {
                    localStorage.setItem('mytoken', res.token)
                    location.href = './index.html'
                }
            }
        })
    })
})